<template>
	<scroll-view v-if="dataSource.length>0" scroll-y style="height: 100%;width: 100%;"
	 @scrolltolower="reachBottom">
		<view class="page-box">
			<slot name="scrollcon"></slot>
			<view class="padding-bottom-xs padding-top-xs" v-if="isShowLoad">
				<u-loadmore  :status="loadStatus"></u-loadmore>
			</view>
			
		</view>
	</scroll-view>
	<view v-else class="list-noDatas">
		<no-info :noDataType="noDataType" :tipText="tipText" :icon="icon"></no-info>
	</view>
</template>
<script>
	import NoInfo from '@/components/noInfoTip.vue'
	import noDataICon from '@/static/images/no-data-icon.png'
	export default {
		name:"scrollLists", //上拉加载更多
		components:{NoInfo},
		props:{
			dataSource:Array,//数据长度是否加载更多
			noDataType:{type:String,default:'list'},//暂无信息类型，（根据类型，显示不同图片）
			loadStatus:{type:String,default:'loadmore'},//加载更多状态 loading / nomore
			tipText:{type:String,default:'暂无信息'},
			icon:{type:String,default:noDataICon}, //无消息自定义图标
			isShowLoad:{type:Boolean,default:true}
		},
		data() {
			return {
			};
		},
		methods:{
			reachBottom(e) {
				this.$emit("reachBottom",e.target.offsetTop)
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.list-noDatas{
		position: absolute;
		top: 40%;
		width: calc(100% - 80rpx);
		transform: translateY(-50%);
	}
</style>
